package com.funong.matrix.biz.user.facade.impl;

import com.funong.matrix.biz.user.domain.SysCompanyDomainDao;
import com.funong.matrix.biz.user.facade.SysCompanyFacade;
import com.funong.matrix.biz.user.pojo.dto.CompanyDeptDTO;
import com.funong.matrix.biz.base.entity.SysCompanyEntity;
import com.funong.matrix.biz.user.pojo.dto.SysCompanyDTO;
import com.funong.matrix.core.dto.QueryDTO;
import com.funong.matrix.core.dto.Result;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author wanjialin
 * @version 1.0
 * @date 2023/5/18
 */
@Service
public class SysCompanyFacadeImpl implements SysCompanyFacade {

    @Resource
    private SysCompanyDomainDao sysCompanyDomainDao;

    @Override
    public List<CompanyDeptDTO> queryCompanyDept(SysCompanyEntity sysCompanyEntity) {
        return sysCompanyDomainDao.queryCompanyDept(sysCompanyEntity);
    }

    @Override
    public List<CompanyDeptDTO> queryCompanyDendrogram(SysCompanyEntity sysCompanyEntity) {
        return sysCompanyDomainDao.queryCompanyDendrogram(sysCompanyEntity);
    }

    @Override
    public Result queryCompany(QueryDTO<SysCompanyEntity> queryDTO) {
        return sysCompanyDomainDao.queryCompany(queryDTO);
    }

    @Override
    public SysCompanyEntity queryCompanyById(Integer Id) {
        return sysCompanyDomainDao.queryCompanyById(Id);
    }

    @Override
    public Boolean saveCompany(SysCompanyEntity sysCompanyEntity) {
        return sysCompanyDomainDao.saveCompany(sysCompanyEntity);
    }

    @Override
    public Boolean updateCompany(SysCompanyEntity sysCompanyEntity) {
        return sysCompanyDomainDao.updateCompany(sysCompanyEntity);
    }

    @Override
    public Boolean deleteCompany(Integer id) {
        return sysCompanyDomainDao.deleteCompany(id);
    }

    @Override
    public Boolean updateCompanyStatus(Integer id) {
        return sysCompanyDomainDao.updateCompanyStatus(id);
    }
}
